<template>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  <el-form-item label="高管编号" prop="num">
    <el-input v-model="ruleForm.num" readonly></el-input>
  </el-form-item>
  <el-form-item label="高管名称" prop="name">
    <el-input v-model="ruleForm.name"></el-input>
  </el-form-item>
  <el-form-item label="职务" prop="zhi">
    <el-select v-model="ruleForm.zhi" placeholder="请输入职务">
      <el-option label="法人代表" value="shanghai"></el-option>
      <el-option label="公司董事长" value="beijing"></el-option>
      <el-option label="公司总经理/厂长/CEO" value="shanghai"></el-option>
      <el-option label="财务主管/CFO" value="beijing"></el-option>
      <el-option label="授权经办人" value="shanghai"></el-option>
      <el-option label="部门经理" value="beijing"></el-option>
      <el-option label="董事" value="shanghai"></el-option>
      <el-option label="监事" value="beijing"></el-option>
      <el-option label="实际控制人" value="beijing"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item label="性别" prop="sex">
    <el-select v-model="ruleForm.sex" placeholder="请输入性别">
      <el-option label="男" value="shanghai"></el-option>
      <el-option label="女" value="beijing"></el-option>
    </el-select>
  </el-form-item>
  
  <el-form-item label="出生日期" required>
    <el-col :span="11">
      <el-form-item prop="comedate">
        <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.comedate" style="width: 100%;"></el-date-picker>
      </el-form-item>
    </el-col>
  </el-form-item>

 <el-form-item label="学历" prop="edu">
    <el-select v-model="ruleForm.edu" placeholder="请输入学历">
      <el-option label="研究生" value="shanghai"></el-option>
      <el-option label="大学本科" value="beijing"></el-option>
      <el-option label="大学专科" value="shanghai"></el-option>
      <el-option label="中专/中等技校" value="beijing"></el-option>
      <el-option label="技术学校" value="shanghai"></el-option>
      <el-option label="高中" value="beijing"></el-option>
      <el-option label="初中" value="shanghai"></el-option>
      <el-option label="小学" value="beijing"></el-option>
      <el-option label="文盲或半文盲" value="shanghai"></el-option>
      <el-option label="未知" value="beijing"></el-option>
    </el-select>
  </el-form-item>

  
  <el-form-item label="登记日期" prop="dengdate">
    <el-input v-model="ruleForm.dengdate" readonly></el-input>
  </el-form-item>
  <el-form-item label="更新日期" prop="gengdate">
    <el-input v-model="ruleForm.gengdate" readonly></el-input>
  </el-form-item>
  
 
  <el-form-item>
    <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
     <el-button type="primary" @click="returnForm('ruleForm')">返回</el-button>
    <el-button @click="resetForm('ruleForm')">重置</el-button>
  </el-form-item>
</el-form>
</template>
<script>
  export default {
    data() {
      return {
        ruleForm: {
          num:'',
          name: '',
          zhi: '',
          sex: '',
          comedate: '',
          edu: '',
          dengdate: '',
          gengdate: ''
        },
        rules: {
          name: [
            { required: true, message: '请输入高管名称', trigger: 'blur' },
          ],
          zhi: [
            { required: true, message: '请选择职务', trigger: 'change' }
          ],
          sex: [
            { required: true, message: '请选择性别', trigger: 'change' }
          ],
          comedate: [
            { type: 'date', required: true, message: '请选择出生日期', trigger: 'blur' }
          ],
          edu: [
            { required: true, message: '请选择学历', trigger: 'change' }
          ]
        }
      };
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      returnForm() {
         this.$router.push({
          path: '/messageedit',
          query: {
            id: this.$route.query.id
          }
        })
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>



<style>
.el-input__inner{

  border:transprant
}
</style>